package com.sfac.javaSpringBoot.modules.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ImageType {
    PROFILE_BIG("profile-big", 100, 220,220),
    PROFILE_SMALL("profile-small",20,50,50);
    public String name;
    public int size;
    public int length;
    public int height;

    ImageType(String name, int size, int length, int height) {
        this.name = name;
        this.size = size;
        this.length = length;
        this.height = height;
    }

    public static ImageType getImageTypeByName(String name){
        for (ImageType imageType:ImageType.values()){
            if (imageType.name.equals(name)){
                return imageType;
            }
        }return null;
    }
}
